package org.demo.service;

import java.util.List;

import org.demo.bean.Person;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * 业务层:PersonService
 * @author  
 * @date    2010-7-20
 * @file    org.demo.service.PersonService.java
 */
public interface PersonService {

	/**
	 * 保存
	 * @param person
	 */
	public abstract void save(Person person);

	/**
	 * 修改
	 * @param person
	 */
	public abstract void update(Person person);

	/**
	 * 删除
	 * @param personId
	 */
	public abstract void delete(int personId);

	/**
	 * 删除所有
	 */
	public abstract void deleteAll();

	/**
	 * 获取
	 * @param personId
	 * @return
	 */
	@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED)
	public abstract Person get(int personId);
	
	/**
	 * 分页查询 [startRow < rowNum <= startRow + maxResult]
	 * @param startRow
	 * @param maxResult
	 * @return
	 */
	@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED)
	public abstract List<Person> get(int startRow,int maxResult);
	
	/**
	 * 获取全部
	 * @return
	 */	
	@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED)
	public abstract List<Person> getAll();

}